#ifndef FILEPREVIEWWIDGET_H
#define FILEPREVIEWWIDGET_H
#include <QMediaPlayer>
#include <QDockWidget>
#include <qlistwidget.h>

namespace Ui {
class FilePreviewWidget;
}

class FilePreviewWidget : public QDockWidget
{
    Q_OBJECT

public:
    explicit FilePreviewWidget(QWidget *parent = nullptr);
    ~FilePreviewWidget();

    void ShowImage();
    void MusicButtonSlot();
    void ShowMusicWidget();
protected:
    void paintEvent(QPaintEvent *event);

private:
    Ui::FilePreviewWidget *ui;
    QImage *image;
    float imageRatio;
    void CloseMusicWidget();
    void InitMusicWidget();
    QString path = "";
public slots:
    void ItemClicked(QListWidgetItem* item);
    void ItemDoubleClicked(QListWidgetItem* item);
};

#endif // FILEPREVIEWWIDGET_H
